package edu.hunan.cxb18.spring.anntation.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;
import java.util.List;
import java.util.Map;

/**
 * @author chenheng
 * @create 2020-03-15 8:39
 */
@Component
public class AnntationBean {
    @Value("2")
    private int id;
    @Value("#{{'haoren','lucy','lili'}}")
    private List<String> list;
    @Value("#{{'key1':'chenheng','key2':'haoren'}}")
    private Map map;

    @Override
    public String toString() {
        return "AnntationBean{" +
                "id=" + id +
                ", list=" + list +
                ", map=" + map +
                '}';
    }
    @PreDestroy
    public void destory(){
        System.out.println("Annotation销毁");
    }
}
